package com.football;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;


 public class welcome extends JFrame{

		private static final long serialVersionUID = 1L;
		JTextField jTextField ;
	    JPasswordField jPasswordField;
	    JLabel jLabel1,jLabel2;
	    JPanel jp1,jp2,jp3;
	    JButton jb1,jb2;

	    public welcome() {
	    	setResizable(false);
	        jTextField = new JTextField(11);
	        jPasswordField = new JPasswordField(12);
	        jPasswordField.setEchoChar('*');
	        
	        jLabel1 = new JLabel("name");
	        jLabel2 = new JLabel("code");
	        jb1 = new JButton("ok");
	        jb2 = new JButton("cancel");
	        jp1 = new JPanel();
	        jp2 = new JPanel();
	        jp3 = new JPanel();
	        
	        this.setLayout(new GridLayout(3,1));
	        
	        jp1.add(jLabel1); 
	        jp1.add(jTextField);
	        
	        jp2.add(jLabel2);
	        jp2.add(jPasswordField);
	        
	        jp3.add(jb1);
	        jp3.add(jb2); 
	        
	        this.add(jp1);
	        this.add(jp2);
	        this.add(jp3);
	     
	        this.setSize(300, 200);
	      
	        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        this.setVisible(true);
	        this.setTitle("LOGIN");
	        
	        judje a =new judje();
	        jb1.addActionListener(a);
	        exit b=new exit();
	        jb2.addActionListener(b);


	        
	        this.setLocationRelativeTo(null);
	    }
		public static void main(String[] args){
			new welcome();
		
		
		}
		class judje implements ActionListener{

			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				if(jTextField.getText().equals("dust")&&jPasswordField.getText().equals("123"))
				{
					dispose();
					DispMemberFrame dispMemberFrame = new DispMemberFrame();
					dispMemberFrame.setVisible(true);
				}
				else
				{JOptionPane.showMessageDialog(null, "wrong input");}
				
			}
			
		}
		
 }
 class exit implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent arg0) {
		System.exit(0);
			
		}
		
	}
	

		
